package com.szpx.service.impl;

import com.szpx.entity.Return;
import com.szpx.mapper.ReturnMapper;
import com.szpx.service.ReturnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ReturnServiceImpl implements ReturnService {

    @Autowired
    private ReturnMapper ReturnMapper;

    @Override
    public List<Return> getAllReturnGoods() {
        return ReturnMapper.selectList();
    }

    @Override
    public int addReturnGoods(Return returnGoods) {
        return ReturnMapper.insert(returnGoods);
    }

    @Override
    public void delReturnGoods(Integer id) {
        ReturnMapper.deleteById(id);
    }

    @Override
    public Return getById(Integer id) {
        return ReturnMapper.getById(id);
    }

    @Override
    public void update(Return returnGoods) {
        ReturnMapper.updateById(returnGoods);
    }
}
